package com.qupai.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * <p>
 * 拍卖商品表，存储拍卖商品信息
 * </p>
 *
 * @author bluefoxyu
 * @since 2024-07-30
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AuctionItem implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "拍卖商品ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "拍卖ID（关联拍卖表）")
    private Long auctionId;

    @Schema(description = "商品名称")
    private String itemName;

    @Schema(description = "商品提供者")
    private String provider;

    @Schema(description = "商品描述")
    private String itemDescription;

    @Schema(description = "起拍价")
    private BigDecimal startingPrice;

    @Schema(description = "当前最高出价")
    private BigDecimal currentHighestBid;

    @Schema(description = "当前最高出价者（关联用户表）")
    private Long currentHighestBidder;

    @Schema(description = "拍卖状态(1、待拍卖, 2、拍卖中, 3、已拍卖)")
    private Integer auctionStatus;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "修改时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "创建人")
    @TableField(value = "create_user",fill = FieldFill.INSERT)
    private Long createUser;

    @Schema(description = "修改人")
    @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

}
